<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <script>
        var msg = "${msg}";
        if (msg != ""){
            alert(msg);
        }
    </script>
    <script src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/style.css">
</head>
<body>
<div class="login-box">
    <h2>Login</h2>
    <form>
        <div class="user-box">
            <input type="text" name="account" required="">
            <label>Username</label>
        </div>
        <div class="user-box">
            <input type="password" name="password" required="">
            <label>Password</label>
        </div>
        <a onclick="login()">
            <span></span>
            <span></span>
            <span></span>
            <span></span>
            Submit
        </a>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="/register.jsp">
            <span></span>
            <span></span>
            <span></span>
            <span></span>
            Register
        </a>
    </form>
</div>

<div style="text-align:center;margin:30px 0; font:normal 14px/24px 'MicroSoft YaHei';color:#ffffff">

</div>

<script>
    function login() {
        var account = $("[name='account']").val();
        var password = $("[name='password']").val();
        location.href="/user/login?account="+account+"&password="+password;
    }
</script>

<%--    登录--%>
<%--    <form method="post" action="/user/login">--%>
<%--        账户：<input name="account" type="text"><br/>--%>
<%--        密码：<input name="password" type="password"><br/>--%>
<%--        <input type="submit" value="登录">--%>

<%--    </form>--%>
<%--        <button onclick="register()">注册</button>--%>

<%--    <script>--%>
<%--        function register() {--%>
<%--            location.href="/user/toRegister";--%>
<%--        }--%>
<%--    </script>--%>
</body>
</html>
